<template>
  <!-- 底部部分 -->
  <footer class="footer">
    <span class="todo-count"
      ><strong>{{ sum }}</strong
      >剩余</span
    >
    <ul class="filters">
      <li>
        <a
          :class="{ selected: type === 'all' }"
          @click="changeBtn('all')"
          href="#/"
          >全部</a
        >
      </li>
      <li>
        <a
          :class="{ selected: type === 'active' }"
          @click="changeBtn('active')"
          href="#/active"
          >进行中</a
        >
      </li>
      <li>
        <a
          :class="{ selected: type === 'completed' }"
          @click="changeBtn('completed')"
          href="#/completed"
          >已完成</a
        >
      </li>
    </ul>
    <button class="clear-completed" @click="delAll" v-if="isShow">
      清除已完成
    </button>
  </footer>
</template>
 
<script>
export default {
  name: "HmFoor",
  props: {
    sum: {
      type: Number,
      required: true,
    },
    isShow: {
      type: Boolean,
      required: true,
    },
    type: {
      type: String,
      required: true,
    },
  },
  data() {
    return {};
  },
  computed: {},
  methods: {
    delAll() {
      this.$emit("delAll");
    },
    changeBtn(value) {
      this.$emit("changeBtn", value);
    },
  },
};
</script>

<style scoped>
</style>